package com.hfxt.dao.impl;

import com.hfxt.dao.RoleDao;
import com.hfxt.entity.Role;
import com.hfxt.tool.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

public class RoleDaoImpl implements RoleDao {

    public Role getRoleByRoleid(Integer roleid) {
        SqlSession sqlSession= MyBatisUtil.getSession();
        Role role=null;
        try{
            role=sqlSession.getMapper(RoleDao.class).getRoleByRoleid(roleid);

        }catch (Exception e){
            e.printStackTrace();
        }finally {
            MyBatisUtil.closeSession();
        }
        return role;
    }
}
